home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM 1995 Fall / PD-ROM F95.toast / Programming / Programming Languages / PC Basic ƒ / PCBASIC Stand alone version / PCBASIC Demo / PCBASICDemolst < prev    next >
Encoding:
Text File  |  1992-02-22  |  3.9 KB  |  152 lines  |  [TEXT/ttxt]

  1. REM
  2. REM    BASIC Compiler Listing of PCBASICDemo.b
  3. REM    Compiled  2/16/92 10:59 AM by PCBASIC  (vers 4.10) 
  4. REM
  5. 1    '  PCDemo, a demonstration program for PCBASIC
  6.  
  7. 10   ' Set up Feature menu items as vectors
  8.  
  9.      KEY(1) ON : ON KEY(1) GOSUB IntlText
  10.      KEY(2) ON : ON KEY(2) GOSUB IBMText
  11.      KEY(3) ON : ON KEY(3) GOSUB FKeyText
  12.      KEY(4) ON : ON KEY(4) GOSUB DLogText
  13.      KEY(5) ON : ON KEY(5) GOSUB MouseText
  14.      KEY(6) ON : ON KEY(6) GOSUB BigText
  15.      KEY(7) ON : ON KEY(7) GOSUB StrongText
  16.  
  17. 20   ' Set up Order menu vector
  18.      FILES MENU ON  : ON FILES MENU GOSUB 800
  19.  
  20.      ' Let Apple-period start Debugger
  21.      BREAK ON : ON BREAK GOSUB Debugger
  22.  
  23.      ' Show intro and wait for operator
  24.      GOSUB IntroText
  25.      
  26. 50   ' Wait for a function key
  27. 55   GOTO 50
  28.  
  29. IntlText ' Text for International
  30.     RESTORE #501   ' Point to text in resource file
  31.     GOTO 1000       ' Display text on the screen
  32. IBMText ' Text for     IBM Compatible
  33.     RESTORE #502 : GOTO 1000
  34. FKeyText ' Text for Menus and Function Keys
  35.     RESTORE #503 : GOTO 1000
  36. DlogText ' Text for Dialog and Alert Boxes
  37.     RESTORE #504 : GOTO 1000
  38. MouseText ' Text for Mouse and Editing
  39.     RESTORE #505 : GOTO 1000
  40. BigText ' Text for Large Programs and Data
  41.     RESTORE #506 : GOTO 1000
  42. StrongText ' Text for Industrial Strength
  43.     RESTORE #507 : GOTO 1000
  44. IntroText ' Text for Introduction
  45.     RESTORE #508 : GOTO 1000
  46.  
  47. 800 ' Order menu subroutine
  48.     LOCATE  ,,2        ' Initialize cursor to an arrow
  49.     Item%= FILES(0) ' Which item in order menu ?
  50.     IF Item%=0 THEN RETURN    ' All done ?
  51.     IF Item%=3 THEN 9999      ' Quit program
  52.  
  53. IF ITEM%=4 THEN 5000
  54.     ' Start order dialog
  55.     DIALOG(501,8+Item%)=1     ' Preset Buy or Information button
  56.     ' Let operator press a button
  57.     GOSUB 810                
  58.     ' Close the dialog
  59.     CLOSE #501              ' Close the dialog
  60.     GOTO 800
  61.  
  62. 810 ' Print, Save or Cancel ?
  63.     
  64.     IF DIALOG(501,11) THEN 830       ' PRINT ?
  65.     IF DIALOG(501,12) THEN 820       ' SAVE ?
  66.     IF DIALOG(501,13) THEN RETURN   ' CANCEL ?
  67.     
  68.     GOTO 810
  69.  
  70. 820 ' Save
  71.     OPEN "Mail List" FOR APPEND AS 1
  72.     FOR I%=2 TO 6
  73.     Item$=DIALOG$(501,I%)     ' Read text from dialog box
  74.     PRINT #1, Item$
  75.     NEXT
  76.  
  77.     ' Get system and order buttons from dialog box
  78.     IF DIALOG(501,7)=1 THEN PRINT#1, "StandAlone " ;
  79.     IF DIALOG(501,8)=1 THEN PRINT#1, "MPW " ;
  80.     IF DIALOG(501,9)=1 THEN PRINT#1, "Manual " ELSE PRINT#1, "Disk "
  81.     CLOSE #1              ' Close the file
  82.     RETURN
  83.     
  84. 830 ' Print
  85.  
  86.      OPEN "LPT2:" AS #2
  87.      PRINT #2,  "Pterodactyl Software"
  88.      PRINT #2,  "200 Davey Glen Rd #416"
  89.      PRINT #2,  "Belmont CA 94002"
  90.      PRINT #2,  " "
  91.      PRINT #2,  " Please send a ";
  92.      IF DIALOG(501,9)=1 THEN PRINT#2, "manual. Enclosed is $50." ELSE PRINT#2,"disk." 
  93.      PRINT #2,  " "
  94.      FOR I%=2 TO 6
  95.      Item$=DIALOG$(501,I%)     ' Read text from dialog box
  96.      PRINT #2, Item$
  97.      NEXT
  98.      PRINT#2,CHR$(12);            ' Form Feed
  99.      CLOSE #2                    ' Close the Printer
  100.      RETURN
  101.  
  102. 1000 ' Display text on screen
  103.      LOCATE #132 ' Show Watch cursor
  104.      CLS
  105.      READ OneLine$
  106.      WHILE OneLine$ <> "END"
  107. 1010 ? OneLine$
  108.      READ OneLine$
  109.      WEND
  110.      LOCATE #300 ' Show custom cursor
  111.      RETURN
  112.  
  113. 9999 ' Exit the PCDemo Program
  114.      END
  115. '
  116. DEBUGGER
  117. '
  118. 5000 ' Break
  119.      BreakPoint$ = STR$(BreakPoint%)
  120.      DIALOG$(650,6) = BreakPoint$
  121.      DIALOG(650,6) = LEN(BreakPoint$)
  122.      DIALOG$(650,7) = "Current Line ="+STR$(TRON(0))
  123.      DIALOG$(650,8) = "OneLine$="+OneLine$
  124.      DIALOG$(650,9) = "Item%="+STR$(Item%)
  125. 5005 ' Wait for a button
  126.      DebugChoice% = DIALOG #650
  127.      BreakPoint% = VAL%(DIALOG$(650,6))
  128.      ON DebugChoice% GOTO 5010,5020,5030
  129.      GOTO 5005
  130. 5010 ' Step
  131.      DIALOG(650,1) = 0
  132.      ON TRON GOSUB 5000
  133.      TRON 
  134.      RETURN
  135. 5020 ' Go till break
  136.      ON TRON GOSUB 5050
  137.      CLOSE 650
  138.      TRON 
  139.      RETURN
  140. 5030 ' Quit Debugger
  141.      ON TRON GOSUB 0
  142.      CLOSE 650
  143.      TROFF 
  144.      RETURN
  145. 5050 ' Check for break
  146.     IF BreakPoint%<>TRON(0) THEN TRON : RETURN ELSE 5000
  147.  
  148.  
  149.  
  150. REM 0 Errors
  151. REM 0 Warnings
  152.